﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Diagnostics;

namespace MemoryLoadStatistics.Models
{
    public class ReadDataCPU : IReaderData
    {
        private PerformanceCounter CPU;

        public ReadDataCPU()
        {
            this.CPU = new PerformanceCounter("Processor", "% Processor Time", "_Total");
        }

        public byte GetData()
        {
            return (byte)this.CPU.NextValue();
        }
    }
}